Skip to content

Fix portfolio projection truth contracts#71

Merged
saagpatel merged 1 commit into
mainfrom
codex/portfolio-truth-canonical-remotes-20260619
Jun 19, 2026
Merged

Fix portfolio projection truth contracts#71
saagpatel merged 1 commit into
mainfrom
codex/portfolio-truth-canonical-remotes-20260619

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

What

Fix the portfolio truth/projection contract lane by adding notion_projection_policy.v2, truth-shadow row support, canonical remote identity selection, and a durable reconciliation note.

Why

The live contract-health audit showed Notion projection drift and two portfolio truth identity mismatches where local archive/import remotes were winning over canonical public repo identities.

Review Of What Was Built

  • Adds projection policy schema/config support for truth-shadow rows.
  • Teaches portfolio truth remote identity selection to prefer canonical, then normal origin, while allowing archive/import origins to yield to a matching public remote.
  • Adds regression tests for canonical remote and ApplyKit archive-origin behavior.
  • Adds the June 19 reconciliation plan with the verified post-repair state.

Cleanup Review

  • Left unrelated decision-queue work out of this PR.
  • Did not mutate live Notion rows, GitHub repo settings, bridge files, databases, or local remotes.

Verification Summary

  • uv run ruff check src/portfolio_truth_sources.py src/project_registry.py tests/test_portfolio_truth.py tests/test_project_registry.py
  • PYTHONDONTWRITEBYTECODE=1 uv run pytest tests/test_portfolio_truth.py tests/test_portfolio_truth_sources.py tests/test_project_registry.py -q
  • Cross-system contract-health passed after the refreshed truth snapshot showed 0 truth-only / 14 audit-only.

Shipped Summary

Portfolio truth now maps ApplyKit and GithubRepoAuditor to their public canonical repo identities, while private archive/import repos remain audit-only.

Next Phase

Decide separately whether any remaining supplementary non-Projects audit-only surfaces should gain registry metadata. Do not promote them into first-class truth without explicit operator approval.

Remaining Roadmap

  • Revisit fable-outputs after the June 22, 2026 campaign window.
  • Keep the remaining archive/support/profile audit-only repos out of truth unless reactivated by operator decision.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6de825d08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +553 to +554
if full_name.rsplit("/", 1)[-1].lower() == checkout_key:
return full_name

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require matching owner before replacing archive origin

When a checkout has an archive/import origin plus a normal upstream remote under another owner, this loop accepts the upstream solely because its repo basename matches the local directory. That changes identity.repo_full_name to the upstream owner/repo, so downstream joins and automation keyed by repo_full_name can target the wrong GitHub repository; the archive repair should only auto-promote same-owner aliases (or an explicit canonical remote).

Useful? React with 👍 / 👎.

@saagpatel saagpatel merged commit 41789c5 into main Jun 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant